home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-21 | 798 b | 31 lines | [TEXT/ttxt] |
- --<<<
- -- Kaleida Labs, Inc.
- -- Field Guide to the ScriptX Language
- -- chapter 6, example 3
-
- --create a module to avoid naming conflicts
- module Scratch22 uses ScriptX end
- in module Scratch22
-
- -- examples of using settings clause of object def expr
-
- -- first create the class
-
- class Novel () inst vars author, title, characters end
-
- -- now create an instance of book
- object myNovel (Novel)
- settings
- author:"Emily Bront\<00e9>"
- title:"Wuthering Heights"
- characters:#("Heathcliff","Catherine")
- end
-
- -- the other way of creating the same object
- -- better give it a new name first if you are going to try it here
-
- global mySecondNovel := new Novel
- mySecondNovel.author := "Emily Bront\<00e9>"
- mySecondNovel.title := "Wuthering Heights"
- mySecondNovel.characters := #("Heathcliff","Catherine")
- -->>>